﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Configuration;

namespace LogManager.WebConfig
{
    /// <summary>
    /// The collection of the event log elements
    /// </summary>
    [ConfigurationCollection(typeof(LogConfiguration),AddItemName="log")]
    public class LogCollection : ConfigurationElementCollection
    {
        public new LogConfiguration this[string name]
        {
            get { return (LogConfiguration)BaseGet(name); }
        }

        public LogConfiguration this[int index]
        {
            get { return (LogConfiguration)BaseGet(index); }
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((LogConfiguration)element).LogName;
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new LogConfiguration();
        }

        public void Add(LogConfiguration archive)
        {
            BaseAdd(archive);
        }

        public void Remove(LogConfiguration archive)
        {
            BaseRemove(archive);
        }
    }
}